<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" id="formAdd">
                <input type="hidden" name="id" value="${data.id}">
                <div class="layui-form-item">
                    <label class="layui-form-label">登录账号</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" name="loginName" lay-verType="tips"
                               value="${data.loginName}" <#if data.loginName!="">readonly<#else> placeholder="请输入登录账号"
                               lay-verify="required"</#if>>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">用户名称</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" lay-verType="tips" placeholder="请输入用户名称"
                               lay-verify="required"
                               name="realName" value="${data.realName}">
                    </div>
                </div>
                <#if data.id=="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户密码</label>
                        <div class="layui-input-inline">
                            <input type="password" name="password" lay-verType="tips" placeholder="请输入用户密码"
                                   lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </#if>
                <div class="layui-form-item">
                    <label class="layui-form-label">所属科室</label>
                    <div class="layui-input-inline">
                        <select name="orgId" lay-verify="required" lay-verType="tips">
                            <option value="">请选择科室</option>
                            <#list dataList as department>
                                <option value="${department.id}" <#if null!=data && data.departmentId=="${department.id}">selected</#if>>${department.name}</option>
                            </#list>
                        </select>
                    </div>
                </div>
                <input type="hidden" lay-submit=""
                       <@shiro.hasPermission name="core/user/index:add or core/user/index:update">
                        lay-filter="modifyData"
                       </@shiro.hasPermission>id="btnAdd"/>
            </form>
        </div>
    </div>
</div>
<script>
    var fn = {};
    layui.config ({
        base: '/static/' //静态资源所在路径
    }).extend ({
        index: 'lib/index' //主入口模块
    }).use (['index', 'core/user_modify']);
</script>